<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>贪吃蛇小游戏</title>
</head>
<body>
    <div class="map"></div>
    <button class="start">开始</button>
    <button class="stop">停止</button>
    
    <script src="game.js"></script>
    <script src="map.js"></script>
    <script src="food.js"></script>
    <script src="snake.js"></script>

    <script>
        const game = new Game('.map')
        let startBtn = document.querySelector('.start');
        let stopBtn = document.querySelector('.stop');
        startBtn.onclick=()=>{
            game.start();
        }
        stopBtn.onclick=()=>{
            game.stop();
        }
    </script>
</body>
</html>